﻿create table [Order] (
	[Id] nvarchar(50) not null primary key,
	[UserId] nvarchar(100) not null,
	[TotalValue] decimal(8, 2) not null,
	[OrderDate] datetime not null
)

create table [OrderItem] (
	[Id] nvarchar(50) not null primary key,
	[OrderId] nvarchar(50) not null,
	[ProdId] nvarchar(50) not null,
	[ProdName] nvarchar(150) not null,
	[ProdDesc] nvarchar(1000) not null,
	[ProdPrice] decimal(8, 2) not null,
	[Quantity] int not null,
	[ImageUrl] nvarchar(150) not null
)

alter table [OrderItem]
	add constraint fk_OrderItem_Order foreign key (orderId)
	references [Order](id)